<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ page import="avicit.platform6.commons.utils.ViewUtil"%>
<%@ taglib prefix="sec"
           uri="/WEB-INF/tags/shiro.tld"%>
<%@page import="avicit.platform6.core.locale.PlatformLocalesJSTL"%>
<%@page import="java.util.Locale"%>
<%@page import="avicit.platform6.api.session.SessionHelper"%>
<%@page import="avicit.platform6.api.sysshirolog.impl.AfterLoginSessionProcess"%>
<%
    Object lang=session.getAttribute(AfterLoginSessionProcess.SESSION_CURRENT_LANGUAGE_CODE);
    String languageCode="zh_CN";
    if(lang!=null){
        languageCode=lang.toString();
    }
    Locale locale =SessionHelper.getLocaleByUser(request);
%>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>新增自定义数据源字段</title>
    <base href="<%=ViewUtil.getRequestPath(request)%>">
    <jsp:include
            page="/avicit/platform6/component/common/EasyUIJsInclude.jsp"></jsp:include>
    <script type="text/javascript"
            src="avicit/im/lantop/basic/reportmanager/js/UserCustomDataSource.js"></script>
    <jsp:include page="/avicit/im/common/ImUIJSCSSInclude.jsp"></jsp:include>
    <script type="text/javascript"
            src="avicit/im/lantop/basic/reportmanager/locale/language_<%=languageCode%>.js"></script>
    <script type="text/javascript">
        var _sysId = '${sysId}';
        var _dialogId = '${dialogId}';
        var _parentId = '${parentId}';



    </script>


    <script type="text/javascript">
        var baseurl = "<%=ViewUtil.getRequestPath(request)%>";
        //此事件必须放在jsp中,不能提取到js中,否则不能加载数据
        $(function() {


        });
    </script>
    <style type="text/css">
        .textbox {
            border: solid 1px #a5acb5;
        }

        .input,img {
            vertical-align: middle;
        }

        <!--
        实现input和img水平对齐 -->.labelbg {
                               background:
                                       url('../../js/jQuery/jquery-easyui-1.3.5/themes/icons/required.gif')
                                       right 0 no-repeat;
                           }
    </style>
</head>
<body id="myBody" class="easyui-layout" fit="true">

<!-- datagrid 工具栏 -->
<div id="tb" style="overflow: hidden; font-size: 0;">
    <sec:accesscontrollist hasPermission="3"
                           domainObject="usercustomdatasource_table_structure_button_addField">
        <%--添加字段 --%>
        <a class="easyui-linkbutton" plain="true" iconCls="icon-im-add"
           onclick="append();" href="javascript:void(0);" id="addTempField"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.addfield","i18n.lantop",locale)%></a>
    </sec:accesscontrollist>
    <sec:accesscontrollist hasPermission="3"
                           domainObject="usercustomdatasource_table_structure_button_deleteField">
        <%--删除字段--%>
        <a class="easyui-linkbutton" plain="true" iconCls="icon-im-remove"
           onclick="removeit('<%=PlatformLocalesJSTL.getBundleValue("lantop.remind","i18n.lantop",locale)%>','<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.deletefield.delrecordremind","i18n.lantop",locale)%>','<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.deletefield.confirmremind","i18n.lantop",locale)%>','<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.deletefield.confirmremind1","i18n.lantop",locale)%>','<%=PlatformLocalesJSTL.getBundleValue("lantop.delete.success","i18n.lantop",locale)%>','<%=PlatformLocalesJSTL.getBundleValue("lantop.delete.failure","i18n.lantop",locale)%>');" href="javascript:void(0);"
           id="deleteTempField"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.deletefield","i18n.lantop",locale)%></a>
    </sec:accesscontrollist>

    <sec:accesscontrollist hasPermission="3"
                           domainObject="usercustomdatasource_table_structure_button_saveField">
        <%--保存--%>
        <a class="easyui-linkbutton" plain="true" iconCls="icon-im-save"
           onclick="accept('<%=PlatformLocalesJSTL.getBundleValue("lantop.remind","i18n.lantop",locale)%>','<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.save.nosave","i18n.lantop",locale)%>','<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.save.notnull","i18n.lantop",locale)%>','<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.save.toolarge","i18n.lantop",locale)%>','<%=PlatformLocalesJSTL.getBundleValue("lantop.save.success","i18n.lantop",locale)%>','<%=PlatformLocalesJSTL.getBundleValue("lantop.save.failure","i18n.lantop",locale)%>');" href="javascript:void(0);" id="saveTempField"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.save","i18n.lantop",locale)%></a>
    </sec:accesscontrollist>

    <sec:accesscontrollist hasPermission="3"
                           domainObject="usercustomdatasource_table_structure_button_cancelField">
        <%--关闭--%>
        <a class="easyui-linkbutton" plain="true" iconCls="icon-im-cancel"
           onclick="cancel();" href="javascript:void(0);" ><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.close","i18n.lantop",locale)%></a>
    </sec:accesscontrollist>

</div>


<div data-options="region:'north',border:false" height="100px" width="100%" >
    <div >
        <table width="100%">
            <tr>
                <%--请输入模板名称：--%>
                <th><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.entertemplatename","i18n.lantop",locale)%></th>
                <td width="80%"><input id="reportName"type="text" class="easyui-validatebox" style="width:80%"/></td>
            </tr>
        </table>

    </div>


</div>

<div data-options="region:'center',border:false" id="colTab"
     style="overflow: hidden; font-size: 0;">
    <table id="cbbTabColumnsDataGrid" class = "easyui-datagrid"
           data-options="
						rownumbers: true,
						collapsible: false,
						fitColumns: true,
						autoRowHeight: false,
						singleSelect: true,
						pagination:true,
						pageSize:10,
						pageList:[100,150,200],
						striped:true,
	     				fit:true,
						method: 'post',
						onClickCell:onClickCell,
						selectOnCheck:false,
						checkOnSelect:false,
						toolbar: '#tb'
					">
        <thead>
        <tr>
            <sec:accesscontrollist hasPermission="3"
                                   domainObject="commtablemanager_table_structure_datagrid_id">
                <%--主键ID--%>
                <th data-options="field:'ID', halign:'center',checkbox:true"
                    title="主键ID" width="20"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.pkid","i18n.lantop",locale)%></th>
            </sec:accesscontrollist>

            <sec:accesscontrollist hasPermission="3"
                                   domainObject="commtablemanager_table_structure_datagrid_colLabel">
                <%--字段中文名--%>
                <th
                        data-options="field:'COLLABEL',halign:'center', align:'center', editor:{type:'validatebox',options:{required:true,validType:'length[0,20]'}},formatter:fomaterColLabel"
                        width="100" title="字段中文名"><img
                        src="avicit/im/common/im_themes_extend/required.gif" alt="必填">
                    <%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.chinesefieldname","i18n.lantop",locale)%></th>
            </sec:accesscontrollist>
            <sec:accesscontrollist hasPermission="3"
                                   domainObject="commtablemanager_table_structure_datagrid_colName">
                <%--字段名--%>
                <th
                        data-options="field:'COLNAME', halign:'center', align:'center', editor:{type:'validatebox',options:{required:true,validType:'length[0,30]'}},formatter:fomaterColName"
                        width="100" title="字段名"><img
                        src="avicit/im/common/im_themes_extend/required.gif" alt="必填"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.fieldname","i18n.lantop",locale)%></th>
            </sec:accesscontrollist>
            <sec:accesscontrollist hasPermission="3"
                                   domainObject="commtablemanager_table_structure_datagrid_colType">
                <%--字段类型--%>
                <th
                        data-options="field:'COLTYPE', halign:'center', align:'center',editor:{type:'combobox',options:{onSelect : typeSelect,onHidePanel: typeOnHidePanel,required:true,panelHeight: 'auto',valueField:'lookupCode',textField:'lookupName',data:[{lookupCode:'string',lookupName:'字符串'},{lookupCode:'integer',lookupName:'整型'},{lookupCode:'date',lookupName:'日期时间型'},{lookupCode:'float',lookupName:'浮点型'}],editable:false}},formatter:fomaterColType"
                        width="100" title="字段类型"><img
                        src="avicit/im/common/im_themes_extend/required.gif" alt="必填"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.fieldtype","i18n.lantop",locale)%></th>
            </sec:accesscontrollist>
            <sec:accesscontrollist hasPermission="3"
                                   domainObject="commtablemanager_table_structure_datagrid_colLength">
                <%--长度--%>
                <th
                        data-options="field:'COLLENGTH', halign:'center', align:'center', editor:{type:'numberbox',options:{'validType':'length[0,5]'}},formatter:fomaterColLength"
                        width="100" title="长度"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.fieldlength","i18n.lantop",locale)%></th>
            </sec:accesscontrollist>
            <sec:accesscontrollist hasPermission="3"
                                   domainObject="commtablemanager_table_structure_datagrid_colDecimal">
                <%--小数位数--%>
                <th
                        data-options="field:'colDecimal', halign:'center', align:'center', editor:{type:'numberbox',options:{'validType':'length[1,6]'}},formatter:fomaterColDecimal"
                        width="100" title="小数位数"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.usercustomdatasource.decimal","i18n.lantop",locale)%></th>
            </sec:accesscontrollist>

        </tr>
        </thead>
    </table>
</div>
</body>
</html>
